/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('globalsearch', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CountProductResourcesRequest {
  keyword?: string(name='Keyword'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  released?: string(name='Released'),
  request?: [ 
    {
      aggregators?: [ string ](name='Aggregators'),
      filter?: [ 
        {
          attributeName?: string(name='AttributeName'),
          attributeValue?: string(name='AttributeValue'),
          operation?: string(name='Operation'),
        }
      ](name='Filter'),
      keyword?: string(name='Keyword'),
      maxItems?: string(name='MaxItems'),
      product?: string(name='Product'),
      resourceType?: string(name='ResourceType'),
    }
  ](name='Request'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CountProductResourcesResponseBody = {
  requestId?: string(name='RequestId'),
  resources?: {
    resource?: [ 
    {
      aggregations?: {
        aggregation?: [ 
        {
          count?: string(name='Count'),
          keys?: string(name='Keys'),
        }
      ](name='Aggregation')
      }(name='Aggregations'),
      product?: string(name='Product'),
      resourceGroupId?: string(name='ResourceGroupId'),
      resourceType?: string(name='ResourceType'),
      total?: string(name='Total'),
    }
  ](name='Resource')
  }(name='Resources'),
}

model CountProductResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CountProductResourcesResponseBody(name='body'),
}

async function countProductResourcesWithOptions(request: CountProductResourcesRequest, runtime: Util.RuntimeOptions): CountProductResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.released)) {
    query['Released'] = request.released;
  }
  if (!Util.isUnset(request.request)) {
    query['Request'] = request.request;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CountProductResources',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function countProductResources(request: CountProductResourcesRequest): CountProductResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return countProductResourcesWithOptions(request, runtime);
}

model DescribeReleasedResourcesRequest {
  detailAttributeNames?: [ string ](name='DetailAttributeNames'),
  filter?: [ 
    {
      attributeName?: string(name='AttributeName'),
      attributeValue?: string(name='AttributeValue'),
      operation?: string(name='Operation'),
    }
  ](name='Filter'),
  global?: string(name='Global'),
  keyword?: string(name='Keyword'),
  marker?: string(name='Marker'),
  maxItems?: int32(name='MaxItems'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  product?: string(name='Product'),
  regionId?: string(name='RegionId'),
  regionNo?: string(name='RegionNo'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tagFilter?: [ 
    {
      operation?: string(name='Operation'),
      tagKey?: string(name='TagKey'),
      tagValues?: [ string ](name='TagValues'),
    }
  ](name='TagFilter'),
}

model DescribeReleasedResourcesResponseBody = {
  estimatedTotal?: int32(name='EstimatedTotal'),
  marker?: string(name='Marker'),
  requestId?: string(name='RequestId'),
  resources?: {
    resource?: [ 
    {
      arn?: string(name='Arn'),
      createTime?: string(name='CreateTime'),
      detail?: map[string]any(name='Detail'),
      matchedAttributes?: string(name='MatchedAttributes'),
      product?: string(name='Product'),
      publicIP?: string(name='PublicIP'),
      regionId?: string(name='RegionId'),
      releaseTime?: string(name='ReleaseTime'),
      resourceGroupId?: string(name='ResourceGroupId'),
      resourceId?: string(name='ResourceId'),
      resourceName?: string(name='ResourceName'),
      resourceType?: string(name='ResourceType'),
      updateTime?: string(name='UpdateTime'),
    }
  ](name='Resource')
  }(name='Resources'),
  truncated?: boolean(name='Truncated'),
}

model DescribeReleasedResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeReleasedResourcesResponseBody(name='body'),
}

async function describeReleasedResourcesWithOptions(request: DescribeReleasedResourcesRequest, runtime: Util.RuntimeOptions): DescribeReleasedResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.detailAttributeNames)) {
    query['DetailAttributeNames'] = request.detailAttributeNames;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.global)) {
    query['Global'] = request.global;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.maxItems)) {
    query['MaxItems'] = request.maxItems;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagFilter)) {
    query['TagFilter'] = request.tagFilter;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeReleasedResources',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeReleasedResources(request: DescribeReleasedResourcesRequest): DescribeReleasedResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeReleasedResourcesWithOptions(request, runtime);
}

model DescribeResourceAggregationsRequest {
  aggAction?: string(name='AggAction'),
  aggregators?: [ string ](name='Aggregators'),
  filter?: [ 
    {
      attributeName?: string(name='AttributeName'),
      attributeValue?: string(name='AttributeValue'),
      operation?: string(name='Operation'),
    }
  ](name='Filter'),
  global?: string(name='Global'),
  keyword?: string(name='Keyword'),
  marker?: string(name='Marker'),
  maxItems?: int32(name='MaxItems'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  product?: string(name='Product'),
  regionId?: string(name='RegionId'),
  regionNo?: string(name='RegionNo'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tagFilter?: [ 
    {
      operation?: string(name='Operation'),
      tagKey?: string(name='TagKey'),
      tagValues?: [ string ](name='TagValues'),
    }
  ](name='TagFilter'),
}

model DescribeResourceAggregationsResponseBody = {
  aggregations?: {
    aggregation?: [ 
    {
      count?: string(name='Count'),
      keys?: string(name='Keys'),
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='Aggregation')
  }(name='Aggregations'),
  requestId?: string(name='RequestId'),
}

model DescribeResourceAggregationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeResourceAggregationsResponseBody(name='body'),
}

async function describeResourceAggregationsWithOptions(request: DescribeResourceAggregationsRequest, runtime: Util.RuntimeOptions): DescribeResourceAggregationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggAction)) {
    query['AggAction'] = request.aggAction;
  }
  if (!Util.isUnset(request.aggregators)) {
    query['Aggregators'] = request.aggregators;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.global)) {
    query['Global'] = request.global;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.maxItems)) {
    query['MaxItems'] = request.maxItems;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagFilter)) {
    query['TagFilter'] = request.tagFilter;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceAggregations',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResourceAggregations(request: DescribeResourceAggregationsRequest): DescribeResourceAggregationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceAggregationsWithOptions(request, runtime);
}

model DescribeResourceFilterAttributesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  product?: string(name='Product'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
}

model DescribeResourceFilterAttributesResponseBody = {
  filterAttributes?: {
    filterAttribute?: [ 
    {
      name?: string(name='Name'),
      supportOperations?: {
        supportOperation?: [ string ](name='SupportOperation')
      }(name='SupportOperations'),
      type?: string(name='Type'),
      values?: {
        value?: [ string ](name='Value')
      }(name='Values'),
    }
  ](name='FilterAttribute')
  }(name='FilterAttributes'),
  requestId?: string(name='RequestId'),
}

model DescribeResourceFilterAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeResourceFilterAttributesResponseBody(name='body'),
}

async function describeResourceFilterAttributesWithOptions(request: DescribeResourceFilterAttributesRequest, runtime: Util.RuntimeOptions): DescribeResourceFilterAttributesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceFilterAttributes',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResourceFilterAttributes(request: DescribeResourceFilterAttributesRequest): DescribeResourceFilterAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceFilterAttributesWithOptions(request, runtime);
}

model DescribeResourceRecommendFiltersRequest {
  attributeName?: string(name='AttributeName'),
  attributeValue?: string(name='AttributeValue'),
  global?: string(name='Global'),
  maxItems?: int32(name='MaxItems'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  product?: string(name='Product'),
  regionId?: string(name='RegionId'),
  regionNo?: string(name='RegionNo'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
}

model DescribeResourceRecommendFiltersResponseBody = {
  recommendFilters?: {
    recommendFilter?: [ 
    {
      attributeName?: string(name='AttributeName'),
      attributeValue?: string(name='AttributeValue'),
      product?: string(name='Product'),
      resourceType?: string(name='ResourceType'),
    }
  ](name='RecommendFilter')
  }(name='RecommendFilters'),
  requestId?: string(name='RequestId'),
}

model DescribeResourceRecommendFiltersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeResourceRecommendFiltersResponseBody(name='body'),
}

async function describeResourceRecommendFiltersWithOptions(request: DescribeResourceRecommendFiltersRequest, runtime: Util.RuntimeOptions): DescribeResourceRecommendFiltersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.attributeName)) {
    query['AttributeName'] = request.attributeName;
  }
  if (!Util.isUnset(request.attributeValue)) {
    query['AttributeValue'] = request.attributeValue;
  }
  if (!Util.isUnset(request.global)) {
    query['Global'] = request.global;
  }
  if (!Util.isUnset(request.maxItems)) {
    query['MaxItems'] = request.maxItems;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResourceRecommendFilters',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResourceRecommendFilters(request: DescribeResourceRecommendFiltersRequest): DescribeResourceRecommendFiltersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceRecommendFiltersWithOptions(request, runtime);
}

model DescribeResourcesRequest {
  detail?: boolean(name='Detail'),
  detailAttributeNames?: [ string ](name='DetailAttributeNames'),
  filter?: [ 
    {
      attributeName?: string(name='AttributeName'),
      attributeValue?: string(name='AttributeValue'),
      operation?: string(name='Operation'),
    }
  ](name='Filter'),
  global?: string(name='Global'),
  keyword?: string(name='Keyword'),
  marker?: string(name='Marker'),
  maxItems?: int32(name='MaxItems'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  page?: int32(name='Page'),
  product?: string(name='Product'),
  regionId?: string(name='RegionId'),
  regionNo?: string(name='RegionNo'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tagFilter?: [ 
    {
      operation?: string(name='Operation'),
      tagKey?: string(name='TagKey'),
      tagValues?: [ string ](name='TagValues'),
    }
  ](name='TagFilter'),
}

model DescribeResourcesResponseBody = {
  estimatedTotal?: int32(name='EstimatedTotal'),
  marker?: string(name='Marker'),
  requestId?: string(name='RequestId'),
  resources?: {
    resource?: [ 
    {
      arn?: string(name='Arn'),
      createTime?: string(name='CreateTime'),
      detail?: map[string]any(name='Detail'),
      matchedAttributes?: map[string]any(name='MatchedAttributes'),
      product?: string(name='Product'),
      publicIP?: string(name='PublicIP'),
      regionId?: string(name='RegionId'),
      resourceGroupId?: string(name='ResourceGroupId'),
      resourceId?: string(name='ResourceId'),
      resourceName?: string(name='ResourceName'),
      resourceType?: string(name='ResourceType'),
      resourceUrl?: string(name='ResourceUrl'),
      updateTime?: string(name='UpdateTime'),
    }
  ](name='Resource')
  }(name='Resources'),
  truncated?: boolean(name='Truncated'),
}

model DescribeResourcesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeResourcesResponseBody(name='body'),
}

async function describeResourcesWithOptions(request: DescribeResourcesRequest, runtime: Util.RuntimeOptions): DescribeResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.detail)) {
    query['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.detailAttributeNames)) {
    query['DetailAttributeNames'] = request.detailAttributeNames;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.global)) {
    query['Global'] = request.global;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.marker)) {
    query['Marker'] = request.marker;
  }
  if (!Util.isUnset(request.maxItems)) {
    query['MaxItems'] = request.maxItems;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.regionNo)) {
    query['RegionNo'] = request.regionNo;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagFilter)) {
    query['TagFilter'] = request.tagFilter;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResources',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeResources(request: DescribeResourcesRequest): DescribeResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourcesWithOptions(request, runtime);
}

model DescribeSupportedProductsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSupportedProductsResponseBody = {
  products?: {
    product?: [ 
    {
      name?: string(name='Name'),
      policy?: string(name='Policy'),
      product?: string(name='Product'),
      resourceTypes?: {
        resourceType?: [ 
        {
          name?: string(name='Name'),
          resourceType?: string(name='ResourceType'),
          supportReleased?: string(name='SupportReleased'),
        }
      ](name='ResourceType')
      }(name='ResourceTypes'),
    }
  ](name='Product')
  }(name='Products'),
  requestId?: string(name='RequestId'),
}

model DescribeSupportedProductsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSupportedProductsResponseBody(name='body'),
}

async function describeSupportedProductsWithOptions(request: DescribeSupportedProductsRequest, runtime: Util.RuntimeOptions): DescribeSupportedProductsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSupportedProducts',
    version = '2021-01-10',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSupportedProducts(request: DescribeSupportedProductsRequest): DescribeSupportedProductsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSupportedProductsWithOptions(request, runtime);
}

